<template>
  <div ref="contentContainer">
    <div  v-html="context"></div>
    <p>aaa</p>
  </div>

</template>

<script>
export default {
    props:{
        context: {
          type: String,
          required: true,
        //   default: "user"
        }
    },
    created(){
        console.log(this.context);
    },
    mounted(){
        this.moveImagesToEnd()
    },
    methods:{
        moveImagesToEnd() {
          const contentContainer = this.$refs.contentContainer;
          const images = contentContainer.querySelectorAll('img').then(()=>{ console.log("找到图片了") }).catch(console.log("没找到图片"));
          images.forEach(img => {
            contentContainer.appendChild(img);
          });
        },
    }
}
</script>

<style>

</style>